/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * Nihongo
 * Copyright (C) Massimiliano Maniscalco 2011, 2012 <massi.neptune@yahoo.com>
 * 
Nihongo is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Nihongo is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _DRAWINGKANJISHEET_H_
#define _DRAWINGKANJISHEET_H_

#include <gtkmm.h>

class Kanji;

using namespace std;

class DrawingKanjiSheet: public Gtk::DrawingArea 
{
public:
	DrawingKanjiSheet ();
	inline void set_kanji_list ( list<Kanji> *pk ) { _kanji = pk; }
	virtual int count_pagine ( void ) = 0;
	virtual void draw_kanji_table (const Cairo::RefPtr<Cairo::Context>& cr);
	virtual void set_up_kanji_table (const Cairo::RefPtr<Cairo::Context>& cr) = 0;
	virtual void draw_kanji_grid ( const Cairo::RefPtr<Cairo::Context>& cr, double dy = 0.0 ) = 0;
	virtual void draw_kanji_at_page ( const Cairo::RefPtr<Cairo::Context>& cr, int pagina, bool pages = false ) = 0;

protected:

	virtual void get_preferred_width_vfunc(int& minimum_width, int& natural_width) const;
	virtual void get_preferred_height_for_width_vfunc(int width, int& minimum_height, int& natural_height) const;
	virtual void get_preferred_height_vfunc(int& minimum_height, int& natural_height) const;
	virtual void get_preferred_width_for_height_vfunc(int height, int& minimum_width, int& natural_width) const;
	virtual void on_size_allocate(Gtk::Allocation& allocation);
	virtual void on_realize();
	virtual bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr);

	Glib::RefPtr<Gdk::Window> m_refGdkWindow;
	list<Kanji> *_kanji;
	double xLeft;
	double xRight;
	double yUp;
	double yDown;
	double cWidth;
	double cHeight;
	double pWidth;
	double pHeight;

private:

};

#endif // _DRAWINGKANJISHEET_H_
